package edu.cmu.cs211.pg.internal;

import static org.junit.Assert.assertEquals;

import java.util.HashSet;

import org.junit.Test;

import edu.cmu.cs211.pg.algorithms.Dijkstra;
import edu.cmu.cs211.pg.algorithms.UnionFind;
import edu.cmu.cs211.pg.graph.MyDirectedGraph;
import edu.cmu.cs211.pg.graph.Path;
import edu.cmu.cs211.pg.graph.WeightedEdge;


public class testUF {
	
	/*
	 * tests the unionfind class by making a small test using 
	 * weightedEdges
	 */
	@Test 
	public void unionFindTest() {
		UnionFind<WeightedEdge> uf=new UnionFind<WeightedEdge>();
		WeightedEdge e = new WeightedEdge(1, 2, 4);
		WeightedEdge e2 = new WeightedEdge(2, 3, 4);
		WeightedEdge e3 = new WeightedEdge(3, 2, 4);
		assertEquals(e, uf.find(e));

		assertEquals(e2, uf.find(e2));
		uf.union(e, e2);

		assertEquals(e, uf.find(e));
		assertEquals(e, uf.find(e2));
		uf.union(e2, e3);
		assertEquals(e, uf.find(e3));

	}


}


